﻿using System;
using System.Collections.Generic;
using System.Text;
using ChaosEngine.EngineCore;
using System.Drawing;
using System.Windows.Forms;
using SlimDX;
namespace ChaosEngine.GPU.Core
{
    /// <summary>
    /// You should extend this core class if you wish to add support for a new graphics api, such as allegro(heh)
    /// </summary>
    public abstract class vGPUCore : vObj 
    {
        public string ApiEnglish { get; set; }

        public Color ClearColor { get; set; }

        public int UpdateCycles { get; set; }

        public vGPUCore(string author, string version, string apiEng)
        {
            ApiEnglish = apiEng;
            Author = author;
            VersionString = version;
            UpdateCycles = 6;
        }

        public bool InitCore()
        {
        
            return InitGpu();
        }

        public abstract vGPUCore SpawnInstance();

        public abstract bool InitGpu();

        public abstract bool EmbedCore(Control surface,string app);

        public abstract void EmbedBeginDraw();

        public abstract void EmbedEndDraw();

        public abstract bool CreateForm(int x, int y, int w, int h, bool full,string app);

        public abstract int RunCore(VividApp app);

        public abstract vDataBuffer CreateVertexBuffer(float[] pos, float[] uv, float[] norm);

        public abstract vDataBuffer CreateIndexBuffer(int[] indices);

        public abstract vEffect EffectFromFile(string addr);

        public abstract void EffectSetFloat(vEffect fx,string name, float v);

        public abstract void EffectSetMatrix(vEffect fx, string name, Matrix v);

        public abstract void EffectSetVector3(vEffect fx, string name, Vector3 v);

        public abstract void EffectSetVector4(vEffect fx, string name, Vector4 v);

        public abstract void DrawGeo(vDataBuffer vertices, vDataBuffer indices, vEffect fx, int tech, int pass);

    }
    public abstract class vTechniquePass
    {
    }
    public abstract class vEffectTechnique
    {
    }
    public abstract class vEffect{
        
     

       

    }
    public abstract class vDataBuffer{


        public abstract void CreateBuffer();


        public abstract void SetData(float[] data);

        public abstract void FreeData();

       
                

    }
}
